<template>
    <div>
      <h2>科室列表</h2>
      <div>
        科室名称:<input type="text" v-model="query.diffname"/>
        <input type="button" value="查询" class="btn btn-primary" @click="showlist"/>
      </div>
      <table class="table table-bordered">
        <tbody>
          <tr>
             <td>科室名称</td>
             <td>科室图片</td>
             <td>成立时间 </td>
          </tr>
          <tr v-for="item in list">
             <td>{{item.differentName}}</td>
             <td><img :src="item.differenImg" height="70px" width="50px"></td>
             <td>{{moment(item.createTime).format("YYYY-MM-DD")}} </td>
          </tr>
        </tbody>
      </table>
    </div>
</template>

<script setup lang="ts">
import axios from 'axios';
import moment from 'moment';
import { ref,reactive,onMounted } from 'vue';
import { useRoute,useRouter } from 'vue-router';
const router=useRouter();
const route=useRoute();


let query:any=reactive
({
  diffname:''
})


let list:any=ref([])
onMounted(()=>{
  showlist();
})
const showlist=()=>
{
  axios
  ({
    url:'/api/Diff/ShowDiff',
    method:'get',
    params:query
  })
  .then(res=>{
    list.value=res.data;
  })
  .catch(err=>{

  })
}

</script>

<style scoped>

</style>